{% extends 'ProyectoMainBundle:Layout:layout.html.twig' %}
{% block content %}
{{ errores }}
	{#
	{% for resultado in resultados %}
		{{ resultado }} 
	{% endfor %}
	#}
        <div>
	<form action="{{ path('plantilla_update', { 'id': entity.id }) }}" method="post" {{ form_enctype(edit_form_plantilla) }}>
	<input type="hidden" name="_method" value="PUT" />
                {{ form_widget(edit_form_plantilla) }}
                <input type="hidden" value="{{ current_page }}" name="current_page" />
                <button type="submit">Edit</button>
        </form>
        <form action="{{ path('plantilla_delete', { 'id': entity.id }) }}" method="post">
            <input type="hidden" name="_method" value="DELETE" />
            {{ form_widget(delete_form_plantilla) }}
            <input type="hidden" value="{{ current_page }}" name="current_page" />
            <button type="submit">Delete</button>
        </form>
        </div>
{% if not forms_elemento %}
  <p>Esta plantilla no contiene elementos.</p>
{% else %}
        <table border="1">
			<tr>
				<th>Contenido</th>
				<th>Orden</th>
				<th>Estilo</th>
				<th>Modificar</th>
				<th>Eliminar</th>
			</tr>
        {% for form_elemento in forms_elemento %}
             <div>
             <tr>
             <form action="{{ path('elemento_update', { 'id': form_elemento.id }) }}" method="post" {{ form_enctype(form_elemento.edit) }}>
               <input type="hidden" name="_method" value="PUT" /> 
               {{ form_widget(form_elemento.edit.valor, { 'attr': {'hidden': 'true'} }) }}
                <td>
                <input value="{{ form_elemento.valor_real }}" readonly />
                </td>
                <td>
                {{ form_row(form_elemento.edit.orden) }}
                </td>
                <td>
                {{ form_row(form_elemento.edit.estilo) }}
                
                        </td>
                <td>
                    <input type="hidden" value="{{ current_page }}" name="current_page" />
                    <button type="submit">Edit</button>
                </td>
            </form>
             <td>
        <form action="{{ path('elemento_delete', { 'id': form_elemento.id }) }}" method="post">
            <input type="hidden" name="_method" value="DELETE" />
            {{ form_widget(form_elemento.delete) }}
            <input type="hidden" value="{{ current_page }}" name="current_page" />
            <button type="submit">Delete</button>
        </form>
                     </td>
        {% endfor %}
        </table>
  {% endif %}
<a href="{{ path('plantilla_listar',{'current_page': current_page }) }}">Volver</a>
{% endblock %}